<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Show Member</title>
<link href="../Public/css/index.css" rel="stylesheet" type="text/css" />
<link href="../Public/css/member.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function init() {
	var user = document.getElementsByTagName('span');
	for(var i=0;i<user.length;i++) {
		if(user[i].className=='member_image_font' && user[i].id!="")
			user[i].innerHTML = '[<a>ID:'+user[i].id+'</a>]';
	}
}
function setUserId(photoid) {
	var id = prompt("请输入会员ID号","");
	if (id!=null && id!="") {
		window.location="__URL__/setVipUserId/photoid/"+photoid+"/userid/"+id; 
	}
}
function deletePhoto(id) {
	if(confirm('确定要删除照片吗?')) {
		
		window.location="__URL__/deleteVip/photoid/"+id; 
	}
}
function uploadCheck() {
	var male = document.getElementsByClassName("male");
	var female = document.getElementsByClassName("female");
	var filepath = document.getElementById("uploadPhoto").value;
	var sex = document.getElementById("sex").value;
	if(sex=='1' && male.length>=8) {
		alert("照片数量已达上限，请先删除照片！");
    	return false;
	}
	if(sex=='0' && female.length>=8) {
		alert("照片数量已达上限，请先删除照片！");
    	return false;
	}
    if(filepath==""){
    	alert("请选择上传的文件！");
    	return false;
  	}
    var extname = filepath.substring(filepath.lastIndexOf(".")+1,filepath.length);
    extname = extname.toLowerCase();//处理了大小写
    if(extname!= "jpg"){
     	alert("只能上传jpg格式的图片！");
      	return false;
     }
    return true;
}
</script>
</head>
<body onload="init()">
<div id="right_font"><img src="../Public/images/main/main_14.gif"
	alt="" /> 您现在所在的位置：<a href="__GROUP__/Index/main" target="mainFrame">首页</a> → 会员展示  → <span
	class="bfont">{$navi}</span></div>
<form action="uploadVip" enctype="multipart/form-data" method="post" onsubmit='return uploadCheck();'>
<div id="info_main">
	<div id="info_main_img"><img
		src="../Public/images/main/main_14.gif" alt="" /><span
		class="adminfont">&nbsp;&nbsp;{$title}</span></div>	
	<div id="member_info_upfile">上传文件： 
		<input type="file" name="uploadPhoto" id="uploadPhoto"/> 
		<input name="sex" type="radio" value="1" checked="true" />男
		<input name="sex" type="radio" value="0" />女 
		<input type="submit" value="上传" />
		<span class="member_image_notice">*点击图片可查看大图，男女图片各最多有8张，上传文件格式为jpg文件。</span>
	</div>
	<div id="member_info_image"><h3>&nbsp;&nbsp;男</h3>
		<volist name="malelist" id="male">
		<div id="member_photo" class="male">
			<a href="{$male.photo_url}" target=_blank>
			<img src="{$male.photo_url}"
			width="90px" height="120px" /></a><br />	
			<span class="member_image_font" id="{$male.user_id}">
			[<a onclick="setUserId('{$male.photo_id}')">添加会员</a>]</span><span class="member_image_font_delete">[<a onclick="deletePhoto('{$male.photo_id}')">删除</a>]</span>
		</div>
		</volist>
	</div>
	<div id="member_info_image"><h3>&nbsp;&nbsp;女</h3>
		<volist name="femalelist" id="female">
		<div id="member_photo" class="female">
			<a href="{$female.photo_url}" target=_blank>
			<img src="{$female.photo_url}"
			width="90px" height="120px" /></a><br />	
			<span class="member_image_font" id="{$female.user_id}">
			[<a onclick="setUserId('{$female.photo_id}')">添加会员</a>]</span><span class="member_image_font_delete">[<a onclick="deletePhoto('{$female.photo_id}')">删除</a>]</span>
		</div>
		</volist>
	</div>
</div>
</form>
</body>
</html>